import 'package:flutter/material.dart';
import 'package:hc_ui/config/hc_default_theme_config.dart';
import 'package:hc_ui/config/hc_image_config.dart';
import 'package:hc_ui/theme/hc_all_theme.dart';

class HcCustomerConfig {
  //单例模式
  static final HcCustomerConfig _instance = HcCustomerConfig._();

  HcCustomerConfig._();

  factory HcCustomerConfig() => _instance;

  ///图片前缀
  String? _imagePrefix;

  //主题模式
  ThemeMode? _themMode;

  //图片的配置
  HcImageConfig? _imageConfig;

  HcAllTheme? _allTheme;

  String get imagePrefix => _imagePrefix ?? '';

  ThemeMode get themeMode => _themMode ?? ThemeMode.light;

  set hcImageConfig(HcImageConfig config) => _imageConfig = config;

  HcImageConfig get hcImageConfig => _imageConfig ?? HcImageConfig();

  set imagePrefix(String imagePrefix) {
    _imagePrefix = imagePrefix;
  }

  set themeMode(ThemeMode themeMode) {
    _themMode = themeMode;
  }

  HcAllTheme get allTheme => _allTheme ?? HcDefaultThemeConfig.defaultAllTheme;

  set allTheme(HcAllTheme value) {
    _allTheme = value..initTheme();
  }
}
